import React, { Component } from 'react'

export default class TongxinC extends Component {
  setNumChild = () => {
    this.props.setNum()
  }
  setNumChildN = () => {
    this.props.setNumN(5)
  }
  render() {
    return (
      <div>
        <p>父组件传递的数据：{this.props.num}</p>
        <button onClick={this.setNumChild}>修改父组件的数据</button>
        <button onClick={this.setNumChildN}>修改父组件的数据--带参数</button>
      </div>
    )
  }
}
